#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cstring>
using namespace std;
const int N=2100;

vector<pair<int,double>> edge[N];

int n,m;
double dist[N];
int vis[N];
struct cmp{
	bool operator()(pair<int,double>& p1,pair<int,double>& p2)
	{
		return p1.second<p2.second;
	}
	
};
void dijkstra(int x)
{
	memset(vis,0,sizeof(vis));
	dist[x]=1;
	priority_queue<pair<int,double>,vector<pair<int,double>>,cmp> q;
	q.push({x,1});
	while(q.size())
	{
		int r=q.top().first;
		double w=q.top().second;
		q.pop();
		if(vis[r])
			continue;
		vis[r]=1;
		for(auto& e:edge[r])
		{
			int t=e.first;
			double ww=e.second;
			ww*=0.01;
			if(dist[t]<dist[r]*(1-ww))
			{
				dist[t]=dist[r]*(1-ww);
				q.push({t,dist[t]});
			}
		}
	}
}
int main()
{
	cin>>n>>m;
	for(int i=1;i<=m;i++)
	{
		int a,b;
		double w;
		cin>>a>>b>>w;
		edge[a].push_back({b,w});
		edge[b].push_back({a,w});
	}
	
	int a,b;
	cin>>a>>b;
	dijkstra(a);
	printf("%.8lf",100.0/dist[b]);
	
	return 0;
}
